package com.chinaoly.baotou;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @description class
 * Create by sunlm
 * on 2022-10-20 17:46
 * Make small but daily progress
 */
public class ProjectTest {
    public static void main(String[] args) {
        JSONObject jsonObject = new JSONObject();
        JSONArray dates = new JSONArray();
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Calendar instance = Calendar.getInstance();
        instance.setTime(date);
        instance.add(Calendar.MONTH,-4);
        dates.add(instance.get(Calendar.YEAR)+"-"+instance.get(Calendar.MONTH));
        instance.add(Calendar.MONTH,1);
        dates.add(instance.get(Calendar.YEAR)+"-"+instance.get(Calendar.MONTH));
        instance.add(Calendar.MONTH,1);
        dates.add(instance.get(Calendar.YEAR)+"-"+instance.get(Calendar.MONTH));
        instance.add(Calendar.MONTH,1);
        dates.add(instance.get(Calendar.YEAR)+"-"+instance.get(Calendar.MONTH));
        instance.add(Calendar.MONTH,1);
        dates.add(instance.get(Calendar.YEAR)+"-"+instance.get(Calendar.MONTH));
        instance.add(Calendar.MONTH,1);
        dates.add(instance.get(Calendar.YEAR)+"-"+instance.get(Calendar.MONTH));
        System.out.println(dates);

    }
}
